package com.yc.weixin.web.Handler;

import java.util.ArrayList;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.yc.weixin.entity.Dede_weixin_tuisongShow;
import com.yc.weixin.entity.WeiXinTempPage;
import com.yc.weixin.service.TuiSongService;

@Controller
@RequestMapping("/tuisong")
public class TuiSongHandler {
		
	@Resource(name="tuiSongService")
	private TuiSongService tuiSongService;
	@RequestMapping("findTypesByPage")
	@ResponseBody
	public WeiXinTempPage<Dede_weixin_tuisongShow> findTypesByPage(int page,int rows){
		WeiXinTempPage<Dede_weixin_tuisongShow> result = tuiSongService.findTypesByPage((page-1)*rows,rows);
		if(result==null){
			result=new WeiXinTempPage<Dede_weixin_tuisongShow>();
			result.setTotal(0);
			result.setRows(new ArrayList<Dede_weixin_tuisongShow>());
		}
		return result;
		
	}
}
